From: Cosimo Cecchi Date: Thu, 11 Oct 2018 00:28:43 +0000 (-0700) Subject: notificationDaemon: separate out GtkNotification creation X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2~1^2~52 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=80a75471291c39000e858970f9327b02a0060658;p=gnome-shell.git notificationDaemon: separate out GtkNotification creation This way, source subclasses can easily use a notification subclass if different functionality is required. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/258 --- diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 81d3e3ae3..4d2be44ed 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -660,6 +660,10 @@ var GtkNotificationDaemonAppSource = new Lang.Class({ return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback); }, + _createNotification(params) { + return new GtkNotificationDaemonNotification(this, params); + }, + activateAction(actionId, target) { this._createApp((app, error) => { if (error == null) @@ -688,7 +692,7 @@ var GtkNotificationDaemonAppSource = new Lang.Class({ if (this._notifications[notificationId]) this._notifications[notificationId].destroy(); - let notification = new GtkNotificationDaemonNotification(this, notificationParams); + let notification = this._createNotification(notificationParams); notification.connect('destroy', () => { delete this._notifications[notificationId]; });